package jwebtester.dal.entities;

// Generated Oct 31, 2012 3:54:40 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * ExpertGroupEntity generated by hbm2java
 */
@Entity
@Table(name = "EXPERT_GROUP", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = {
		"NAME", "ORGANIZATION_ID" }))
public class ExpertGroupEntity implements java.io.Serializable {

	private int id;
	private UserEntity userEntity;
	private OrganizationEntity organizationEntity;
	private String name;
	private String description;
	private Date createdOn;
	private Set<ExpertsEntity> expertsEntities = new HashSet<ExpertsEntity>(0);

	public ExpertGroupEntity() {
	}

	public ExpertGroupEntity(int id, UserEntity userEntity, OrganizationEntity organizationEntity,
			String name, Date createdOn) {
		this.id = id;
		this.userEntity = userEntity;
		this.organizationEntity = organizationEntity;
		this.name = name;
		this.createdOn = createdOn;
	}

	public ExpertGroupEntity(int id, UserEntity userEntity, OrganizationEntity organizationEntity,
			String name, String description, Date createdOn, Set<ExpertsEntity> expertsEntities) {
		this.id = id;
		this.userEntity = userEntity;
		this.organizationEntity = organizationEntity;
		this.name = name;
		this.description = description;
		this.createdOn = createdOn;
		this.expertsEntities = expertsEntities;
	}

	@Id
	@Column(name = "ID", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CREATED_BY", nullable = false)
	public UserEntity getUserEntity() {
		return this.userEntity;
	}

	public void setUserEntity(UserEntity userEntity) {
		this.userEntity = userEntity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ORGANIZATION_ID", nullable = false)
	public OrganizationEntity getOrganizationEntity() {
		return this.organizationEntity;
	}

	public void setOrganizationEntity(OrganizationEntity organizationEntity) {
		this.organizationEntity = organizationEntity;
	}

	@Column(name = "NAME", nullable = false, length = 64)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "DESCRIPTION", length = 256)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATED_ON", nullable = false, length = 26)
	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "expertGroupEntity")
	public Set<ExpertsEntity> getExpertsEntities() {
		return this.expertsEntities;
	}

	public void setExpertsEntities(Set<ExpertsEntity> expertsEntities) {
		this.expertsEntities = expertsEntities;
	}

}
